<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
//			浏览器窗口大小发生变化时会执行
			window.onresize = function(){
				var w = document.documentElement.clientWidth;
				var h = document.documentElement.clientHeight;
				console.log(w,h);
//				document.write('w='+w+'   h='+h);
//				document.write('<br/>');
				
//				操作浏览器可是区域宽高,解决兼容.
				var w = document.documentElement.clientWidth || document.body.clientWidth;
				var h = document.documentElement.clientHeight || document.body.clientHeight;
				
				
				
			}
		</script>
	</body>
</html>
